const Module = {
    Core: {}
};

export const init = () => {
    return import('wxy_core').then((Core) => {
        return Promise.all([
            import(`wxy_core/http`),
        ]).then((modules) => {
            Module.Core = {
                ...modules.reduce((prev, cur) => {
                    return {
                        ...prev,
                        ...cur
                    };

                }, {}),
                ...Core
            }

            Object.freeze(Module);

            return Module;
        });
    });
};

export const loadCore = () => Module.Core;
